package com.chu.dao;

import com.chu.bean.People;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.repository.CrudRepository;

import java.util.Date;
import java.util.List;

public interface PeopleDao extends CrudRepository<People,Integer> {


    //根据姓名模糊查询
    List<People> findByNameLike(String name);

    //根据姓名和地址查询
    List<People> findByNameAndAddress(String name,String address);

    //根据Id区间查询
    List<People> findByIdBetween(int begin,int end);

    //日期小于等于
    List<People> findByDateLessThanEqual(Date date);

//    地址模糊查询
    List<People> findByAddressLike(String address);
//    根据Id做in查询
    List<People> findByIdIn(int[] id);
    //查询address不是在China的数量
    Integer countByAddressIsNotLike(String address);
    //查询全部根据日期降序
    List<People> findAll(Sort sort);
    //in查询id并分页
    Page<People> findByIdIn(List list, Pageable pageable);









}
